
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h2>属性值操作</h2>
<input type="text" name="userame" value="tom" class="orange" weight="311">
<script type="text/javascript">
var nm=document.getElementsByTagName('input')[0];
 console.log(nm.attributes.value);
</script>
</body>
</html>